/*
 * XML Type:  search
 * Namespace: 
 * Java type: com.guardianapis.api.domain.xmlbeans.Search
 *
 * Automatically generated - do not modify.
 */
package com.guardianapis.api.domain.xmlbeans.impl;
/**
 * An XML search(@).
 *
 * This is a complex type.
 */
public class SearchImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.guardianapis.api.domain.xmlbeans.Search
{
    private static final long serialVersionUID = 1L;
    
    public SearchImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RESULTS$0 = 
        new javax.xml.namespace.QName("", "results");
    private static final javax.xml.namespace.QName FILTERS$2 = 
        new javax.xml.namespace.QName("", "filters");
    private static final javax.xml.namespace.QName COUNT$4 = 
        new javax.xml.namespace.QName("", "count");
    private static final javax.xml.namespace.QName STARTINDEX$6 = 
        new javax.xml.namespace.QName("", "start-index");
    
    
    /**
     * Gets the "results" element
     */
    public com.guardianapis.api.domain.xmlbeans.Results getResults()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Results target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Results)get_store().find_element_user(RESULTS$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "results" element
     */
    public void setResults(com.guardianapis.api.domain.xmlbeans.Results results)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Results target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Results)get_store().find_element_user(RESULTS$0, 0);
            if (target == null)
            {
                target = (com.guardianapis.api.domain.xmlbeans.Results)get_store().add_element_user(RESULTS$0);
            }
            target.set(results);
        }
    }
    
    /**
     * Appends and returns a new empty "results" element
     */
    public com.guardianapis.api.domain.xmlbeans.Results addNewResults()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.Results target = null;
            target = (com.guardianapis.api.domain.xmlbeans.Results)get_store().add_element_user(RESULTS$0);
            return target;
        }
    }
    
    /**
     * Gets the "filters" element
     */
    public com.guardianapis.api.domain.xmlbeans.TagList getFilters()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.TagList target = null;
            target = (com.guardianapis.api.domain.xmlbeans.TagList)get_store().find_element_user(FILTERS$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "filters" element
     */
    public void setFilters(com.guardianapis.api.domain.xmlbeans.TagList filters)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.TagList target = null;
            target = (com.guardianapis.api.domain.xmlbeans.TagList)get_store().find_element_user(FILTERS$2, 0);
            if (target == null)
            {
                target = (com.guardianapis.api.domain.xmlbeans.TagList)get_store().add_element_user(FILTERS$2);
            }
            target.set(filters);
        }
    }
    
    /**
     * Appends and returns a new empty "filters" element
     */
    public com.guardianapis.api.domain.xmlbeans.TagList addNewFilters()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.guardianapis.api.domain.xmlbeans.TagList target = null;
            target = (com.guardianapis.api.domain.xmlbeans.TagList)get_store().add_element_user(FILTERS$2);
            return target;
        }
    }
    
    /**
     * Gets the "count" attribute
     */
    public int getCount()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COUNT$4);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "count" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetCount()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(COUNT$4);
            return target;
        }
    }
    
    /**
     * Sets the "count" attribute
     */
    public void setCount(int count)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COUNT$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(COUNT$4);
            }
            target.setIntValue(count);
        }
    }
    
    /**
     * Sets (as xml) the "count" attribute
     */
    public void xsetCount(org.apache.xmlbeans.XmlInt count)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(COUNT$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(COUNT$4);
            }
            target.set(count);
        }
    }
    
    /**
     * Gets the "start-index" attribute
     */
    public int getStartIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$6);
            if (target == null)
            {
                return 0;
            }
            return target.getIntValue();
        }
    }
    
    /**
     * Gets (as xml) the "start-index" attribute
     */
    public org.apache.xmlbeans.XmlInt xgetStartIndex()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(STARTINDEX$6);
            return target;
        }
    }
    
    /**
     * Sets the "start-index" attribute
     */
    public void setStartIndex(int startIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(STARTINDEX$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(STARTINDEX$6);
            }
            target.setIntValue(startIndex);
        }
    }
    
    /**
     * Sets (as xml) the "start-index" attribute
     */
    public void xsetStartIndex(org.apache.xmlbeans.XmlInt startIndex)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlInt target = null;
            target = (org.apache.xmlbeans.XmlInt)get_store().find_attribute_user(STARTINDEX$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlInt)get_store().add_attribute_user(STARTINDEX$6);
            }
            target.set(startIndex);
        }
    }
}
